#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
using namespace std;
int main() {
	int arr[6] = {3,2,7,5,4,1};
	int i = 0;
	int maxarea = 0;
	for (i = 0; i < 6; i++) {
		int x = arr[i];
		int y = 1;
		for (int j = i+1; j < 6; j++) {
			if (arr[j] >= arr[i])y++;
			else break;
		}
		for (int j = i - 1; j > 0; j--) {
			if (arr[j] >= arr[i])y++;
			else break;
		}
		if (x * y > maxarea)maxarea = x*y;
	}
	cout << maxarea << endl;
	return 0;
}